<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jQuery-min.js"></script>
</head>

<body>
    <div id="title"></div>
    <div>
        姓名
        <span id="name"></span>
    </div>
    <div>
        年龄
        <span id="age"></span>
    </div>
    <div>
        会员
        <span id="isVip"></span>
    </div>
    <div>
        注册时间
        <span id="regTime"></span>
    </div>
    <div>
        爱好
        <ul id="hobby">
            <li>爱好1</li>
            <li>爱好2</li>
        </ul>
    </div>

</body>
<script>
    // 传统渲染UI结构 
    // 繁琐
    $(function() {
        var data = {
            title: '<h3>用户信息</h3>',
            name: 'zs',
            age: 20,
            isVIP: true,
            regTime: new Date(),
            hobby: ['吃饭', '睡觉', '打豆豆']
        };
        $('#title').html(data.title);
        $('#name').html(data.name);
        $('#age').html(data.age);
        $('#isVip').html(data.isVIP);
        $('#regTime').html(data.regTime);

        var rows = [];
        $.each(data.hobby, function(i, item) {
            rows.push(`<li>${item}</li>`)
        });
        $('#hobby').html(rows.join(''));
    })
</script>
<script>
    // art-template模板引擎是一个简约超快的模板引擎 中文官网
    // http://aui.github.io/art-template/zh-cn/index.html
</script>

</html>